80026714	0x	loopus test for matching codeword range
	accepts A0=codeword
	returns V0=p->matching entry offset or 0
LUI	V0,8004
ADDIU	V0,V0,4690	;V0=80044690: table of codewords and ROM addresses
LW	T6,0004 (V0)	;T6=end codeword
OR	V1,V0,R0
BEQL	T6,R0,80026768	;last entry is zero
OR	V0,R0,R0
LW	T7,0000 (V1)	;T7=start codeword
//80026730:	loopus!
SLTU	AT,A0,T7
BNEL	AT,R0,80026758	;branch if code < start
LW	T9,0014 (V1)
LW	T8,0004 (V1)	;T8=end codeword
SLTU	AT,A0,T8
BEQL	AT,R0,80026758	;branch if codeword greater than endpoint
LW	T9,0014 (V1)
JR	RA
OR	V0,V1,R0
LW	T9,0014 (V1)	;T9=next end codeword
//80026758: 
ADDIU	V1,V1,0010	;V1+=10: next entry in table
BNEL	T9,R0,80026730	;branch if more entries; next endpoint !=0
LW	T7,0000 (V1)	;T7=start codeword
OR	V0,R0,R0
//80026768:	Quit!
JR	RA
NOP

+-+

80026770	0x	returns V0=ROM offset or -1 on fail
	accepts: A0=codeword
ADDIU	SP,SP,FFE8
SW	RA,0014 (SP)
JAL	80026714		;find codeword A0->ROM in table
SW	A0,0018 (SP)
LW	A0,0018 (SP)	;not that this would change...
BEQ	V0,R0,800267C8	;fail if no match found
OR	V1,V0,R0		;V1=matching entry
LW	T6,000C (V0)	;T6=ROM end
BNEL	T6,R0,800267B0	;hit in compressed file!
LW	T0,0000 (V0)	;T0=start codeword
//80026798:	uncompressed files, ie text banks
LW	T7,0008 (V1)	;T7=ROM offset
LW	T9,0000 (V1)	;T9=start codeword
ADDU	T8,T7,A0		;T8=ROM+codeword
BEQ	R0,R0,800267CC
SUBU	V0,T8,T9		;V0=final ROM (T8-initial)
LW	T0,0000 (V0)
//800267B0:	compressed files
BNE	A0,T0,800267C0	;fail if start codeword does not match end...
NOP
BEQ	R0,R0,800267CC
LW	V0,0008 (V1)	;V0=ROM offset
//800267C0:	extreneous fail routine
BEQ	R0,R0,800267CC
ADDIU	V0,R0,FFFF
//800267C8:	bail!
ADDIU	V0,R0,FFFF	;V0=-1 on a very bad run
LW	RA,0014 (SP)
ADDIU	SP,SP,0018
JR	RA
NOP

+-+

800267DC	0x	??? - returns index for matching entry in ROM<->code table
	called by 80026828...
ADDIU	SP,SP,FFE8
SW	RA,0014 (SP)
JAL	80026714		;find codeword A0->ROM in table
NOP
BEQ	V0,R0,80026808	;fail if it wasn't found!
LW	RA,0014 (SP)
LUI	T6,8004
ADDIU	T6,T6,4690	:T6=80044690: start of ROM<->codeword table
SUBU	V0,V0,T6		;V0=offset in table to entry
BEQ	R0,R0,8002680C
SRA	V0,V0,0x4	;V0=offset/0x10
//80026808:	fail, or skip to 8002680C to quit sucessfully
ADDIU	V0,R0,FFFF
JR	RA
ADDIU	SP,SP,0018

